# _*_coding:utf-8_*_
__author__ = 'gerry'

import MySQLdb

# 创建链接
conn = MySQLdb.connect(host="127.0.0.1", port=3306, user="root", passwd="123456", db="python")
cur = conn.cursor()
reCount = cur.execute("select * from catering_dish_profit")  # 统计影响行数
data = cur.fetchall()  # 拿出所有数据

# 插入数据
sql = 'INSERT  into catering_dish_profit VALUES(%s,%s,%s)'
params = (1, "A5", 213)
insert = cur.execute(sql, params)




# 关闭链接
cur.close()
conn.commit()
conn.close()

print(reCount)
print(data)
print(insert)
